<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Fenlei_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-fenlei_id" data-rule="required" data-source="pifa/fenlei/index" data-field="title" class="form-control selectpage" name="row[fenlei_id]" type="text" value="{$row.fenlei_id|htmlentities}">
        </div>
    </div>
  
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-desc" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" class="form-control" size="50" name="row[images]" type="textarea" value="{$row.images|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Kucun')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-kucun" class="form-control" name="row[kucun]" type="number" value="{$row.kucun|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Canshu')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-canshu" class="form-control " rows="5" name="row[canshu]" cols="50">{$row.canshu|htmlentities}</textarea>
        </div>
    </div> -->


      <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Canshu')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="col-xs-12">
                <table class="table fieldlist" data-template="eventtpl1" data-name="row[canshu]" id="second-table">
                    <tr>
                        <td>{:__('参数名称')}</td>
                        <td>{:__('参数值')}</td>
                        <td width="100"></td>
                    </tr>
                    <tr >
                        <td colspan="4"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                    </tr>
                </table>
                <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
                <textarea name="row[canshu]" class="form-control" cols="30" rows="5" style="display:none">{$row.canshu|htmlentities}</textarea>
                <script id="eventtpl1" type="text/html">
                    <tr class="form-inline">
                                
                                  <td><input type="text" name="<%=name%>[<%=index%>][name]" class="form-control" style="width:120px" value="<%=row.name%>" placeholder="参数名称"/></td>
                                  <td><input type="text" name="<%=name%>[<%=index%>][val]" class="form-control" style="width:120px" value="<%=row.val%>" placeholder="参数值"/></td>
                                 
                                    <td>
                                        <!--下面的两个按钮务必保留-->
                                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                                    </td>
                                </tr>
                            </script>
            </div>
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
        </div>
    </div>
      <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_state')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="goodsStateList" item="vo"}
            <label for="row[goods_state]-{$key}"><input id="row[goods_state]-{$key}" name="row[goods_state]" type="radio" value="{$key}" {in name="key" value="$row.goods_state"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>
        </div>
    </div>

    <div data-favisible="goods_state=0" class="p-3">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('经销商返佣金额')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-b_price" class="form-control" name="row[b_price]" type="number" value="{$row.b_price|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('门店返佣金额')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-c_price" class="form-control" name="row[c_price]" type="number" value="{$row.c_price|htmlentities}">
            </div>
        </div>
    </div>


      <div data-favisible="goods_state=1" class="p-3">
            <div class="form-group row">
                  
                        <div class="col-xs-12">
                            <table class="table fieldlist" data-template="eventtpl" data-name="row[goodsitem]" id="second-table">
                                <tr>

                                    <td>{:__('商品名称')}</td>
                                    <td>{:__('价格')}</td>
                                    <td>{:__('库存')}</td>
                                    <td>{:__('经销商返佣')}</td>
                                    <td>{:__('门店返佣')}</td>
                                    <td width="100"></td>
                                </tr>
                                <tr s>
                                    <td colspan="4"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                                </tr>
                            </table>

                            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
                            <textarea name="row[goodsitem]" class="form-control" cols="30" rows="5" style="display:none">{$row.goodsitem|htmlentities}</textarea>
                            <script id="eventtpl" type="text/html">
                                <tr class="form-inline">
                                    <td style="display: none"><input type="text" name="<%=name%>[<%=index%>][id]" class="form-control" style="width:120px" value="<%=row.id%>" placeholder="ID"/></td>
                                  <td><input type="text" name="<%=name%>[<%=index%>][name]" class="form-control" style="width:120px" value="<%=row.name%>" placeholder="商品名称"/></td>
                                  <td><input type="text" name="<%=name%>[<%=index%>][price]" class="form-control" style="width:120px" value="<%=row.price%>" placeholder="价格"/></td>
                                  <td><input type="text" name="<%=name%>[<%=index%>][kucun]" class="form-control" style="width:120px" value="<%=row.kucun%>" placeholder="库存"/></td>
                                  <td><input type="text" name="<%=name%>[<%=index%>][b_price]" class="form-control" style="width:120px" value="<%=row.b_price%>" placeholder="经销商返佣"/></td>
                                  <td><input type="text" name="<%=name%>[<%=index%>][c_price]" class="form-control" style="width:120px" value="<%=row.c_price%>" placeholder="门店返佣"/></td>
                                    <td>
                                        <!--下面的两个按钮务必保留-->
                                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                                    </td>
                                </tr>
                            </script>
                        </div>
                    </div>                  
     </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Open_switch')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-open_switch" class="form-control selectpicker" name="row[open_switch]">
                {foreach name="openSwitchList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.open_switch"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
